<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>登陆成功 || 欢迎登录中央认证系统</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <#include "/common/import.ftl" >
</head>

<style>
    .kk {
        background-color: #ddffa9;
        height: 100px;
        width: auto;
    }

    .km {
        padding-top: 10px;
        padding-left: 50px;
        float: left;
    }

    .ks {
        padding-top: 20px;
        padding-left: 130px;
    }

    .ks pm {
        font-size: 20px;
        color: #026804;
    }

    .ks tp {
        font-size: 12px;
        color: #026804;
    }
</style>

<script type="text/javascript">

    $(function () {
        //初始化界面优先加载上次用户登录信息
        getLastMsg();
    });


    //右下角显示上次登录记录
    function getLastMsg() {
        var outUrl = '${ctx}/passport/last/lastmsg.action';
        var mainPage = '${ctx}';
        $.ajax({
            url: outUrl,
            type: 'post',
            success: function (result) {
                // var result = jQuery.parseJSON(data);
                var mst = '';
                if (result.userEname == undefined) {
                    mst = '欢迎登录统一用户系统!';
                } else {
                    mst += '用户名:' + result.userEname;
                    mst += '<br>上次登录IP:' + result.lgnLastipaddress;
                    mst += '<br>上次登录系统:' + result.sysEname;
                    mst += '<br>上次登录系统类型:' + result.lgnJudge;
                    mst += '<br>上次登录系统版本:' + result.lgnLastdevice;
                    mst += '<br>最后登录时间:' + result.lgnLasttime;
                }
                //显示上次用户登录记录
                $.messager.show({
                    title: '上次登录记录',
                    msg: mst,
                    timeout: 5000,
                    height: 200,
                    width: 300,
                    showType: 'slide'
                });
            },
            error: function (data) {
                alert("请检查服务器!");
            }
        });
    }


    //用户退出
    function lgnout() {
        $.messager.confirm('提示', '您确定工作已经保存,并退出该系统?', function (r) {
            if (r) {
                var outUrl = '${ctx}/passport/logout/logout.action';
                var mainPage = '${ctx}';
                $.ajax({
                    url: outUrl,
                    type: 'post',
                    success: function (result) {
                        // var result = jQuery.parseJSON(data);
                        if (result.flag == 'T') {
                            window.location.href = '${ctx}';
                        } else {
                            $.messager.alert('提交结果', result.msg, 'info');
                        }
                    },
                    error: function (data) {
                        alert("请检查服务器!");
                    }
                });
            }
        });
    }

</script>
<body>
<div class="kk">
    <div class="km">
        <br>
    </div>
    <div class="ks">
        <pm>登录成功!</pm>
        <br>
        <tp>您已经成功登陆中央认证系统.</tp>
        <br>
        <tp>出于安全考虑,一旦您访问过那些需要您提供凭证信息的应用时,请操作完成之后关闭浏览器.</tp>
        <tp><a href="javascript:lgnout();">退出</a>
        <#if isSysAdmin??><a href="${ctx}/passport/ssosys/console" class="easyui-linkbutton"
                             id="bt1"
                             iconCls="icon-save">进入系统管理控制台</a></#if>
        </tp>
    </div>
</div>
</body>
</html>
